<extend name="Public/layout" />

<block name="content">
    <section class="wrapper">
        <!-- page start-->
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        增加权限
                    </header>
                    <div class="panel-body">
                        <div class=" form">
                            <form class="ajax-from-submit" action="{:U('Admin/AdminAuth/edit')}" method="post">
                                <input name="id" type="hidden" value="{$auth.id}">
                                <div class="form-group">
                                    <label for="add_pid">状态</label>
                                    <select name="pid" id="add_pid" class="form-control">
                                        <option value="0">顶级菜单</option>
                                        <volist name="menu" id="v1">
                                            <option value="{$v1.id}">{$v1.title}</option>
                                            <notempty name="v1.child">
                                                <volist name="v1.child" id="v2">
                                                    <option value="{$v2.id}">&nbsp;|-{$v2.title}</option>
                                                    <notempty name="v2.child">
                                                        <volist name="v2.child" id="v3">
                                                            <option value="{$v3.id}">&nbsp;&nbsp;|-{$v3.title}</option>
                                                        </volist>
                                                    </notempty>
                                                </volist>
                                            </notempty>
                                        </volist>

                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="add_title">权限名称</label>
                                    <input name="title" type="text" value="{$auth.title}" class="form-control"  id="add_title" placeholder="请输入名称" required>
                                </div>
                                <div class="form-group">
                                    <label for="add_url">URL</label>
                                    <input name="url" type="text" value="{$auth.url}" class="form-control" id="add_url" placeholder="请输入URL">
                                </div>
                                <div class="form-group">
                                    <label for="add_desc">描述</label>
                                    <input name="desc" type="text" value="{$auth.desc}" class="form-control" id="add_desc" placeholder="请输入描述" required>
                                </div>
                                <div class="form-group">
                                    <label for="add_ico">ICO图标</label>
                                    <input name="ico" type="text" value="{$auth.ico}" class="form-control" id="add_ico" placeholder="请输入ICO图标">
                                </div>
                                <div class="form-group">
                                    <label for="add_sort">排序</label>
                                    <div id="spinner">
                                        <div class="input-group input-small">
                                            <input name="sort" type="text" value="{$auth.sort}" id="add_sort" class="spinner-input form-control"  maxlength="2" readonly>
                                            <div class="spinner-buttons input-group-btn btn-group-vertical">
                                                <button type="button" class="btn spinner-up btn-xs btn-default">
                                                    <i class="fa fa-angle-up"></i>
                                                </button>
                                                <button type="button" class="btn spinner-down btn-xs btn-default">
                                                    <i class="fa fa-angle-down"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="add_hide">状态</label>
                                    <select name="hide" id="add_hide" class="form-control">
                                        <option value="0" <eq name="auth.hide" value="0">selected="selected"</eq>>显示</option>
                                        <option value="1" <eq name="auth.hide" value="1">selected="selected"</eq>>隐藏</option>
                                    </select>
                                </div>
                                <div class="form-group " >
                                    <button class="btn btn-info ajax-form-btn" type="submit">提交</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </section>
            </div>
        </div>
        <!-- page end-->
    </section>
</block>

<block name="javascript">
    <script type="text/javascript" src="__ADMIN__/assets/fuelux/js/spinner.min.js"></script>
    <script>
        $('#spinner').spinner();
        MenuHighlight('{:U("Admin/AdminAuth/index")}');
    </script>
</block>